import React, { Component } from 'react'
import RouterView from '../../router/routerView'
import routes from '../../router/routerConfig'
import { Route, Switch, NavLink, Link } from 'react-router-dom'
import { RouterItem } from "../../types/router.d"

import { Tabbar } from 'react-vant';
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons';

interface INPROPS {
  children: RouterItem[]
}
export class Index extends Component<INPROPS> {
  render() {
    const { children } = this.props
    return (
      <div>
        <div>
          <RouterView routes={children} ></RouterView>
        </div>
        <div>
          <Tabbar>
            <Tabbar.Item icon={<HomeO />}>
              <NavLink to="/index/home">首页</NavLink>
            </Tabbar.Item>
            <Tabbar.Item icon={<Search />}>
            <NavLink to="/index/car">分类</NavLink>
            </Tabbar.Item>
            <Tabbar.Item icon={<SettingO />}>
            <NavLink to="/index/my">我的</NavLink>
            </Tabbar.Item>
          </Tabbar>
        </div>
      </div>
    )
  }
}

export default Index